<form action="/cart" method="post">
    <input type="hidden" name="productId" value="<%= product.id %>">
    <button type="submit" class="btn">Add to Cart</button>
</form>